//
//  UIBarButtonItem+Extension.swift
//  HYYWeibo
//
//  Created by HY-Mac on 16/7/9.
//  Copyright © 2016年 HY-Mac. All rights reserved.
//

import UIKit

extension UIBarButtonItem{
    convenience init(imageName: String, target: AnyObject?, action: Selector){
        let leftBtn = UIButton()
        leftBtn.setImage(UIImage(named: imageName), forState: .Normal)
        leftBtn.setImage(UIImage(named: imageName + "_highlighted"), forState: .Highlighted)
        leftBtn.sizeToFit()
        leftBtn.addTarget(target, action: action, forControlEvents: .TouchUpInside)
        self.init(customView: leftBtn)
    }
}
